﻿package org.aquiferserver.common 
{
	
	/**
	 * ...
	 * @author Seth Albanese
	 * @version $Id: MessageType.as 60 2009-06-15 08:47:09Z salbanese0080@gmail.com $
	 */
	[RemoteClass(alias="org.aquiferserver.common.MessageType")]
	public class MessageType 
	{
		
		public static var MT_SERV:MessageType = 				new MessageType( 0 );
		public static var MT_PEER:MessageType = 				new MessageType( 1 );
		public static var MT_HANDSHAKE:MessageType = 			new MessageType( 2 );
		public static var MT_HANDSHAKE_CONFIRM:MessageType = 	new MessageType( 3 );
		public static var MT_ERROR:MessageType = 				new MessageType( 4 );
		public static var MT_CONNECTED:MessageType = 			new MessageType( 5 );
		public static var MT_PEER_CONNECT:MessageType = 		new MessageType( 6 );
		public static var MT_PEER_DISCONNECT:MessageType = 		new MessageType( 7 );
		
		public static var MT_COMPOSIT:MessageType = 			new MessageType( 8 );
		
		private var _type:int;
		
		public function MessageType( t:int = 1 ) 
		{
			_type = t;
		}
		
		public function set type( t:int ) : void
		{
			_type = t;
		}
		
		public function get type() : int
		{
			return _type;
		}
		
		public function equals( obj:Object ) : Boolean
		{
			if ( !( obj is org.aquiferserver.common.MessageType ) )
			{
				return false;
			}
			
			var other:MessageType = MessageType( obj );
			return other.type == this.type;
		}
		
		
	}
	
}